package com.yss.reportworld.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yss.common.core.web.domain.BaseEntity;

/**
 * 字段校验规则对象 report_world_table_detail_standard_check
 *
 * @author yss
 * @date 2023-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("report_world_table_detail_standard_check")
public class TableDetailStandardCheck extends BaseEntity {

    /**  */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    /**
     * 字段名称
     */
    @ExcelProperty(value = "字段名称")
    @TableField("COLUMN_NAME")
    private String columnName;

    /**
     * 字段中文名称
     */
    @ExcelProperty(value = "字段中文名称")
    @TableField("COLUMN_CHINESE_NAME")
    private String columnChineseName;

    /**
     * 字段类型
     */
    @ExcelProperty(value = "字段类型")
    @TableField("COLUMN_TYPE")
    private Integer columnType;

    /**
     * 字段长度
     */
    @ExcelProperty(value = "字段长度")
    @TableField(value = "COLUMN_LENGTH", insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private Integer columnLength;

    /**
     * 数字类型的时候小数位数
     */
    @ExcelProperty(value = "数字类型的时候小数位数")
    @TableField(value = "COLUMN_DECIMAL", insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private Integer columnDecimal;

    /**
     * 是否可为空 1.是2否
     */
    @ExcelProperty(value = "是否可为空 1.是2否")
    @TableField(value = "COLUMN_NULL", insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private Integer columnNull;

    /**
     * 默认值
     */
    @ExcelProperty(value = "默认值")
    @TableField("COLUMN_DEFAULT")
    private String columnDefault;

    /**
     * 主键1.主键，2非主键
     */
    @ExcelProperty(value = "主键", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=主键,2=非主键")
    @TableField(value = "PRIMARY_KEY", insertStrategy = FieldStrategy.IGNORED, updateStrategy = FieldStrategy.IGNORED)
    private Integer primaryKey;

    /**  */
    @ExcelProperty(value = "状态", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=正常,2=停用")
    @TableField("STATUS")
    private Integer status;

    // 导出的时候选择 数据的主键
    @ExcelIgnore
    @TableField(exist = false)
    private String ids;

}
